package com.im.test;

import java.io.IOException;
import java.net.Socket;
import java.util.Date;

public class IOClient {

	
	public static void main(String[] args) {
		
		
		new Thread(new Runnable() {
			
			@Override
			public void run() {
				try {
					Socket socket = new Socket("localhost", 8000);
					while(true){
						socket.getOutputStream().write((new Date() + ": hello world").getBytes());
						try {
							Thread.sleep(2000);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
					}
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}).start();
		
		
		
		
		
	}
	
}
